# A tibble: 7,874 × 7
age sex sample_yr creatinine mgus_factor futime death
<dbl> <fct> <dbl> <dbl> <fct> <dbl> <dbl>
1 97 F 1997 1.7 No MGUS 0.233 1
2 92 F 2000 0.9 No MGUS 3.51 1
3 94 F 1997 1.4 No MGUS 0.189 1
4 92 F 1996 1 No MGUS 0.315 1
5 93 F 1996 1.1 No MGUS 2.84 1
6 90 F 1997 1 No MGUS 3.71 1
7 90 F 1996 0.8 No MGUS 7.81 1
8 90 F 1999 1.2 No MGUS 1.02 1
9 93 F 1996 1.2 No MGUS 9.06 1
10 91 F 1996 0.8 No MGUS 3.63 1
# ℹ 7,864 more rows
rifttable’s data model
The design
# A tibble: 5 × 6
type label exposure event time arguments
<chr> <chr> <chr> <chr> <chr> <list>
1 total Participants mgus_fa… death futi… <named list>
2 events/time Deaths/person-years mgus_fa… death futi… <named list>
3 cuminc 10-year risk mgus_fa… death futi… <named list>
4 cumincratio 10-year risk ratio (9… mgus_fa… death futi… <named list>
5 hr Hazard ratio (95% CI) mgus_fa… death futi… <named list>
The data
# A tibble: 7,874 × 7
age sex sample_yr creatinine mgus_factor futime death
<dbl> <fct> <dbl> <dbl> <fct> <dbl> <dbl>
1 97 F 1997 1.7 No MGUS 0.233 1
2 92 F 2000 0.9 No MGUS 3.51 1
3 94 F 1997 1.4 No MGUS 0.189 1
4 92 F 1996 1 No MGUS 0.315 1
5 93 F 1996 1.1 No MGUS 2.84 1
6 90 F 1997 1 No MGUS 3.71 1
7 90 F 1996 0.8 No MGUS 7.81 1
8 90 F 1999 1.2 No MGUS 1.02 1
9 93 F 1996 1.2 No MGUS 9.06 1
10 91 F 1996 0.8 No MGUS 3.63 1
# ℹ 7,864 more rows
# A tibble: 5 × 6
type label exposure event time arguments
<chr> <chr> <chr> <chr> <chr> <list>
1 total Participants mgus_fa… death futi… <named list>
2 events/time Deaths/person-years mgus_fa… death futi… <named list>
3 cuminc 10-year risk mgus_fa… death futi… <named list>
4 cumincratio 10-year risk ratio (9… mgus_fa… death futi… <named list>
5 hr Hazard ratio (95% CI) mgus_fa… death futi… <named list>
The data
# A tibble: 7,874 × 7
age sex sample_yr creatinine mgus_factor futime death
<dbl> <fct> <dbl> <dbl> <fct> <dbl> <dbl>
1 97 F 1997 1.7 No MGUS 0.233 1
2 92 F 2000 0.9 No MGUS 3.51 1
3 94 F 1997 1.4 No MGUS 0.189 1
4 92 F 1996 1 No MGUS 0.315 1
5 93 F 1996 1.1 No MGUS 2.84 1
6 90 F 1997 1 No MGUS 3.71 1
7 90 F 1996 0.8 No MGUS 7.81 1
8 90 F 1999 1.2 No MGUS 1.02 1
9 93 F 1996 1.2 No MGUS 9.06 1
10 91 F 1996 0.8 No MGUS 3.63 1
# ℹ 7,864 more rows
Shows descriptive and inferential statistics side-by-side
Makes stratified analyses easy (and table 2 fallacies hard)
Rounds estimates well
Facilitates sensitivity analyses
Extends with custom estimators
Has a website with copy-paste examples
The IDEFICS/I.Family cohort
The IDEFICS/I.Family cohort: Table 1
rifttable, v0.7.1
Also…
Quantiles and quantile regression
Ratios of continuous outcomes
Competing events
Clustering
Trends (slopes)
Stratified and joint models
Inverse probability-weighted estimates
Regression-based risk ratios and risk differences for binary outcomes
https://stopsack.github.io/rifttable
Regression models for risk ratios and risk differences
In cohort studies […], there is little reason to consider an odds ratio. While odds ratios are not the primary measure of interest, they are frequently reported because of the statistical model used by the investigators to analyze their data.
Exposure
Unexposed
Exposed
Total
1000
1000
Cases/non-cases
20/980
40/960
Risk
2%
4%
Risk ratio
1 (reference)
2.00 (1.18, 3.4)
Odds ratio
1 (reference)
2.04 (1.20, 3.6)
Exposure
Unexposed
Exposed
Total
1000
1000
Cases/non-cases
960/40
980/20
Risk
96%
98%
Risk ratio
1 (reference)
1.02 (1.01, 1.04)
Odds ratio
1 (reference)
2.04 (1.20, 3.6)
Why are we still reporting odds ratios in cross-sectional and cohort studies?
Log-binomial modelsdo not converge
data(breastcancer, package ="risks")glm(formula = death ~ stage + receptor, data = breastcancer, family =binomial(link ="log"))
Error: no valid set of coefficients has been found: please supply starting values
“Poisson” models with robust varianceoften do not converge either
Marginal standardization/g-computation/g-formula with time-fixed exposureworks whenever a logistic model can be fit
And there is Miettinen’s case-duplication approach
We no longer need to report odds ratios in cross-sectional and cohort studies
library(risks)summary(riskratio(formula = death ~ stage + receptor, data = breastcancer ))
Risk ratio model, fitted via marginal standardization of a logistic model with delta method (margstd_delta).
Call:
stats::glm(formula = death ~ stage + receptor, family = binomial(link = "logit"),
start = "(no starting values)")
Coefficients: (3 not defined because of singularities)
Estimate Std. Error z value Pr(>|z|)
stageStage I 0.0000 0.0000 NaN NaN
stageStage II 0.8989 0.3875 2.320 0.0203 *
stageStage III 1.8087 0.3783 4.781 1.75e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 228.15 on 191 degrees of freedom
Residual deviance: 185.88 on 188 degrees of freedom
AIC: 193.88
Number of Fisher Scoring iterations: 4
Confidence intervals for coefficients: (delta method)
2.5 % 97.5 %
stageStage I 0.0000000 0.000000
stageStage II 0.1395299 1.658324
stageStage III 1.0671711 2.550242
Estimating and reporting adjusted risk ratios and risk differences made easy
The tables in our manuscripts can and should be made directly by software
Several R packages create various types of tables
The rifttable package is designed specifically for epidemiologists and with best-practice result reporting in mind
One perk are regression models for adjusted risk ratios and risk differences for binary outcomes from the risks package
This automation makes table creation easier, faster, and reproducible
We can focus on thinking about our results instead of transcribing numbers
Thank you for your attention – Please reach out
stopsack@leibniz-bips.de
We are hiring!
The Leibniz Institute for Prevention Research and Epidemiology – BIPS is one of Germany’s largest and oldest research institutes focused on epidemiology.
Applications are open now for our PhD Program in Epidemiology, Statistics, and Prevention and Implementation Science, with an October start date.
https://tinyurl.com/ bips-phd-program
Feel free to reach out about this opportunity and others.